OPTIMIZE_FLAG = -O3

all : libanalyzer.a
	mv ./libanalyzer.a ../example/
	$(MAKE) oclean

src:=$(wildcard *.c)
src_cpp:=$(wildcard *.cpp)
obj:$(src:.c=.o) $(src_cpp:.cpp=.o)

libanalyzer.a:obj
	ar -rv -o $@ ./*.o
	- ranlib $@

%.o:%.c
	gcc $(OPTIMIZE_FLAG) -c $< -o $@ -DCALCULATE_TYPE_R64 -fopenmp -lpthread -lm

%.o:%.cpp
	g++ $(OPTIMIZE_FLAG) -c $< -o $@ -DCALCULATE_TYPE_R64 -fopenmp -lpthread -lm

oclean:
	-(rm ./*.o)

clean : oclean
	-(rm ./analyzer.elf)
	-(rm ./libanalyzer.a)
